package com.example.sociamedia.post.mapper;

import com.example.sociamedia.post.entity.Post;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

@Mapper
public interface PostMapper {
    @Insert("INSERT INTO posts (UserId, Content, MediaUrl, MediaType, CreatedAt, UpdatedAt, IsPublic) VALUES (#{userId}, #{content}, #{mediaUrl}, #{mediaType}, #{createdAt}, #{updatedAt}, #{isPublic})")
    @Options(useGeneratedKeys = true,  keyColumn = "PostId",keyProperty = "postId")
    int insertPost(Post post);


} 